package wjh.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wjh.mapper.ZlyExamFormMapper;
import wjh.pojo.ExamForm;
import wjh.pojo.ReportUserDoctor;

import java.util.List;

@Service
public class ZlyExamFormServiceImpl implements ZlyExamFormService {
    @Autowired
    private ZlyExamFormMapper zlyExamFormMapper;

    @Override
    public void saveForm(ExamForm examForm, int money) {
        zlyExamFormMapper.saveForm(examForm);
        zlyExamFormMapper.saveOrder(examForm.getReport_number(), money);
    }

    @Override
    public void saveExamtoDoct(String reportNumber, Integer pid, Integer did) {
        zlyExamFormMapper.saveExamtoDoct(reportNumber, pid, did);
    }

    @Override
    public void changeState(String reportNumber, int status) {
        zlyExamFormMapper.changeState(reportNumber, status);
    }

    @Override
    public ReportUserDoctor findReportUserDoctorByDid(Integer did) {
        return zlyExamFormMapper.findReportUserDoctorByDid(did);
    }

    @Override
    public ExamForm findByReportNumber(String reportNumber) {
        return zlyExamFormMapper.findByReportNumber(reportNumber);
    }

    @Override
    public void subExam(String subExam, String rNumber) {
        zlyExamFormMapper.subExam(subExam, rNumber);
    }

    @Override
    public void delRUD(String rNumber, int did) {
        zlyExamFormMapper.delRUD(rNumber, did);
    }

    @Override
    public Object checkReportDone(String rNumber) {
        return zlyExamFormMapper.checkReportDone(rNumber);
    }

    @Override
    public List<ExamForm> findByPname(String pname) {
        return zlyExamFormMapper.findByPname(pname);
    }
}
